{template 'common/header'}
<ul class="nav nav-tabs">
    <li {if $operation=='display' } class="active" {/if}>
        <a href="{php echo $this->createWebUrl('item_order', array('op' => 'display'));}">积分兑换订单</a>
    </li>
</ul>
{if $operation=='display'}
<form action="" class="form-horizontal form" method="post" enctype="multipart/form-data">
    <div style="padding:15px;">
        <table class="table table-hover table-condensed">
            <thead class="navbar-inner">
                <tr>
                    <tr>

                    <th>id</th>

					<th>商品名</th>

					<th>数量</th>

					<th>积分</th>

					<th>金额</th>

					<th>支付状态</th>

					<th>订单号</th>

					<th>用户姓名</th>

					<th>手机号</th>

					<th>地址</th>

                    <th>状态</th>

                    <th>兑换时间</th>

					<th style="text-align:right;">操作</th>

                </tr>
            </thead>
                <tbody id="level-list">

                {loop $list $item}
                <tr>
<?php
					   $user = array();
					   if($settings['system_type'] == 1){
				           $user = pdo_get($this->modulename . "_user_u", array("unionid" => $item['unionid'],'system_id' => $settings['system_id']));
						   $i = pdo_get($this->modulename . "_item", array("item_id" => $item['item_id'],'system_id' => $settings['system_id']));
					   }else{
					       $user = pdo_get($this->modulename . "_user", array("openid" => $item['openid'],'uniacid' => $_W['uniacid']));
						   $i = pdo_get($this->modulename . "_item", array("item_id" => $item['item_id'],'uniacid' => $_W['uniacid']));
					   }
				    ?>

                    <td>{$item['order_id']}</td>
					<td>{$i['title']}</td>
					<td>{$item['num']}</td>
					<td>{$item['price']}</td>
					<td>{$item['market_price']}</td>
					<td>{if $item['pay_status'] == 1 && $item['market_price'] > 0}已支付{/if}{if $item['pay_status'] == 0 && $item['market_price'] == 0}已支付{/if}</td>
					<td>{$item['orderid']}</td>
					<td>
					

                        <img style="width: 40px;" src="{$user['avatar']}">

                        {$item['name']}

                    </td>
					<td>{$item['mobile']}</td>

					<td>{$item['address']}</td>

					<td>{if $item['is_over'] == 0}待发货{/if}{if $item['is_over'] == 1}已发货{/if}{if $item['is_over'] == 2}已完成{/if}</td>

					<td><div class="type-parent">{if $item['create_time']}{php echo date('Y-m-d H:i:s',$item['create_time'])}{/if}</div></td>

					<td style="text-align:right;">
					    {if $item['is_over'] != 2}
					    <a href="{php echo $this->createWebUrl('item_order_fahuo', array('op' => 'post', 'id' => $item['order_id']))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top">{if $item['is_over'] == 0}发货{/if}{if $item['is_over'] == 1}修改发货{/if}</a>
						{/if}
						<a href="{php echo $this->createWebUrl('item_order', array('op' => 'delete', 'id' => $item['order_id']))}"class="btn btn-default btn-sm" onclick="return confirm('此操作不可恢复，确认删除？');return false;" data-toggle="tooltip" data-placement="top" title="删除"><i class="fa fa-times"></i></a>
					</td>



                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
</form>
<!-- 确认发货 -->
<div id="modal-confirmsend" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
				<h3>快递信息</h3>
			</div>
			<div class="modal-body">
				<div class="form-group">
					<label class="col-xs-10 col-sm-3 col-md-3 control-label">快递公司</label>
					<div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
						<select class="form-control" name="express" id="express">
							<option value="" data-name="">--选择快递公司--</option>
							{loop $express $erow}
							<option value="{$erow['value']}" {if $item['express'] == $erow['value']}selected="selected"{/if} data-name="{$erow['pinyin']}">{$erow['value']}</option>
							{/loop}
						</select>
						<input type='hidden' name='expresscom' value="{$item['expresscom']}" id='expresscom' />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-10 col-sm-3 col-md-3 control-label">快递单号</label>
					<div class="col-xs-12 col-sm-9 col-md-8 col-lg-8">
						<input type="text" name="expresssn" value="{$item['expresssn']}" class="form-control" />
						<span class="help-block" style="color:red;">自发配送可在快递单号中输入备注信息</span>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="submit" class="btn btn-primary span2" name="confirmsend" value="yes">确认发货</button>
				<a href="#" class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</a>
			</div>
		</div>
	</div>
	</form>
</div>
{/if}
{template 'common/footer'}
